*********************************************************
*********************************************************
*** Replications
*********************************************************
*********************************************************

use repdata, clear

global c1 "wdi_lngdppc_L1 wdi_growth_L1 kaopen_L1 lnresource_L1 trade_WDI_L1 bitstodate_BIT_L1 lnaid_L1 unfdi_inflow_gdp_L1 cinc_milex_ln_L1 polconiii_L1 arch_lndura ucdp_interstate_L1 conflict_low_L1"

global c2 "nonexpyrs decade* i.region"
global cfixed "i.ccode"
global nonepyrs "nonexpyrs nonexpyrs2 nonexpyrs3"

global M1 "debtGDP_fill_L1" // Moderator1



*------------------------------------------------
* Table 1 and Figure 1 (the first three graphs)
*------------------------------------------------

// Model (1) Naive Conflict Model
probit expropriation_dum intrawar_dum_L1 $c1 $c2 $nonepyrs, robust cluster(ccode)
outreg2 using table_debttogdp, dec(3) word label replace


// Model (2) Probit with No Fixed Effects
probit expropriation_dum intrawar_dum_L1##c.$M1 $c1 $c2 $nonepyrs, robust cluster(ccode)
outreg2 using table_debttogdp, dec(3) word label

su $M1 if e(sample), detail

margins, dydx(intrawar_dum_L1) at($M1 = (0(1)320))  
marginsplot, yline(0, lpattern(solid) lwidth(thin)) ///
	title("Model (2)", size(3))  ///	
	xtitle("Debt (% of GDP)", size(3)) ///
	ytitle("", size(3)) ylabel(, labsize(small)) ///
	xscale(r(0(50)320)) xlabel(0(50)320, labsize(small)) recast(line) ciopt(color(%70)) recastci(rline) ///
	plotregion(fcolor(white)) graphregion(fcolor(white)) ///
	legend(off) scheme(s1mono) saving(figure_debttogdp_1.gph, replace) ///
	addplot(hist $M1 if $M1<320, xlabel(0(50)320, labsize(small)) freq yaxis(2) yscale(alt axis(2)) bin(600) lcolor(grayscale7) lwidth(vvthin) color(grayscale6%20) xline(62.5864, lpattern(dash) lwidth(vthin)) ytitle("", axis(2)) ylabel("", axis(2))      ) 

count if e(sample)
count if e(sample) & $M1 > 79 & $M1 ~= .  // 23.5%

// substantive effects	
probit expropriation_dum intrawar_dum_L1##c.$M1 $c1 $c2 $nonepyrs, robust cluster(ccode)
sum $M1 if e(sample), detail  
margins, at(intrawar_dum_L1= 0 $M1 = 62.686) at(intrawar_dum_L1 = 1 $M1 = 62.686) post predict(pr) 
mlincom 2 - 1

probit expropriation_dum intrawar_dum_L1##c.$M1 $c1 $c2 $nonepyrs, robust cluster(ccode)
margins, at(intrawar_dum_L1= 0 $M1 = 134.51163) at(intrawar_dum_L1 = 1 $M1 = 134.51163) post predict(pr) 
mlincom 2 - 1

probit expropriation_dum intrawar_dum_L1##c.$M1 $c1 $c2 $nonepyrs, robust cluster(ccode)
margins, at(intrawar_dum_L1= 0 $M1 = 160.39) at(intrawar_dum_L1 = 1 $M1 = 160.39) post predict(pr) 
mlincom 2 - 1


// Model (3) Probit with Fixed Effects
probit expropriation_dum intrawar_dum_L1##c.$M1 $c1 $c2 $nonepyrs $cfixed, robust cluster(ccode)
outreg2 using table_debttogdp, dec(3) word label

su $M1 if e(sample), detail

margins, dydx(intrawar_dum_L1) at($M1 = (0(1)320))  
marginsplot, yline(0, lpattern(solid) lwidth(thin)) ///
	title("Model (3)", size(3))  ///	
	xtitle("Debt (% of GDP)", size(3)) ///
	ytitle("", size(3)) ylabel(, labsize(small)) ///
	xscale(r(0(50)320)) xlabel(0(50)320, labsize(small)) recast(line) ciopt(color(%70)) recastci(rline) ///
	plotregion(fcolor(white)) graphregion(fcolor(white)) ///
	legend(off) scheme(s1mono) saving(figure_debttogdp_2.gph, replace) ///
	addplot(hist $M1 if $M1<320, xlabel(0(50)320, labsize(small)) freq yaxis(2) yscale(alt axis(2)) bin(600) lcolor(grayscale7) lwidth(vvthin) color(grayscale6%20) xline(63.65594, lpattern(dash) lwidth(vthin)) ytitle("", axis(2)) ylabel("", axis(2))      ) 

count if e(sample)
count if e(sample) & $M1 >= 53 & $M1 ~= .  // 46.3%

	
// Model (4) Negative Binomial with Fixed Effects (nonconvergence with fixed effects)
nbreg expropriation intrawar_dum_L1##c.$M1 $c1 $c2, robust cluster(ccode)
outreg2 using table_debttogdp, dec(3) word label

su $M1 if e(sample), detail

margins, dydx(intrawar_dum_L1) at($M1 = (0(1)320))  
marginsplot, yline(0, lpattern(solid) lwidth(thin)) ///
	title("Model (4)", size(3))  ///	
	xtitle("Debt (% of GDP)", size(3)) ///
	ytitle("", size(3)) ylabel(, labsize(small)) ///
	xscale(r(0(50)320)) xlabel(0(50)320, labsize(small)) recast(line) ciopt(color(%70)) recastci(rline) ///
	plotregion(fcolor(white)) graphregion(fcolor(white)) ///
	legend(off) scheme(s1mono) saving(figure_debttogdp_3.gph, replace) ///
	addplot(hist $M1 if $M1<320, xlabel(0(50)320, labsize(small)) freq yaxis(2) yscale(alt axis(2)) bin(600) lcolor(grayscale7) lwidth(vvthin) color(grayscale6%20) xline(62.48697, lpattern(dash) lwidth(vthin)) ytitle("", axis(2)) ylabel("", axis(2))      ) 
	
	
// Combining Graphs
graph combine figure_debttogdp_1.gph figure_debttogdp_2.gph figure_debttogdp_3.gph, saving(figure_debttogdp_123, replace) col(2)




*------------------------------------------------
* Table 2 and Figure 1 (the next three graphs)
*------------------------------------------------


use repdata, clear

global c1 "wdi_lngdppc_L1 wdi_growth_L1 kaopen_L1 lnresource_L1 trade_WDI_L1 bitstodate_BIT_L1 lnaid_L1 unfdi_inflow_gdp_L1 cinc_milex_ln_L1 polconiii_L1 arch_lndura ucdp_interstate_L1 conflict_low_L1"

global c2 "nonexpyrs decade* i.region"
global cfixed "i.ccode"
global nonepyrs "nonexpyrs nonexpyrs2 nonexpyrs3"

global M2 "dept_gdp_boc_2023_L1" // Moderator2


// Model (1) Probit with No Fixed Effects
probit expropriation_dum intrawar_dum_L1##c.$M2 $c1 $c2 $nonepyrs, robust cluster(ccode)
outreg2 using table_debtdefault, dec(3) word label replace

su $M2 if e(sample), detail

margins, dydx(intrawar_dum_L1) at($M2 = (0(1)120))  
marginsplot, yline(0, lpattern(solid) lwidth(thin)) ///
	title("Model (5)", size(3))  ///	
	xtitle("Debt in Default (% of GDP)", size(3)) ///
	ytitle("", size(3)) ylabel(, labsize(small)) ///
	xscale(r(0(20)120)) xlabel(0(20)120, labsize(small)) recast(line) ciopt(color(%70)) recastci(rline) ///
	plotregion(fcolor(white)) graphregion(fcolor(white)) ///
	legend(off) scheme(s1mono) saving(figure_debtdefault_1.gph, replace) ///
	addplot(hist $M2 if $M2<120, xlabel(0(20)120, labsize(small)) freq yaxis(2) yscale(alt axis(2)) bin(600) lcolor(grayscale7) lwidth(vvthin) color(grayscale6%20) xline(11.94262, lpattern(dash) lwidth(vthin)) ytitle("", axis(2)) ylabel("", axis(2))      ) 

count if e(sample)
count if e(sample) & $M2 >= 34 & $M2 ~= .  // 8.8%
	
// substantive effects	
probit expropriation_dum intrawar_dum_L1##c.$M2 $c1 $c2 $nonepyrs, robust cluster(ccode)
sum $M2 if e(sample), detail  
margins, at(intrawar_dum_L1= 0 $M2 = 12.01411) at(intrawar_dum_L1 = 1 $M2 = 12.01411) post predict(pr) 
mlincom 2 - 1

probit expropriation_dum intrawar_dum_L1##c.$M2 $c1 $c2 $nonepyrs, robust cluster(ccode)
margins, at(intrawar_dum_L1= 0 $M2 = 47.28322) at(intrawar_dum_L1 = 1 $M2 = 47.28322) post predict(pr) 
mlincom 2 - 1

probit expropriation_dum intrawar_dum_L1##c.$M2 $c1 $c2 $nonepyrs, robust cluster(ccode)
margins, at(intrawar_dum_L1= 0 $M2 = 159.35) at(intrawar_dum_L1 = 1 $M2 = 159.35) post predict(pr) 
mlincom 2 - 1

			
// Model (2) Probit with Fixed Effects
probit expropriation_dum intrawar_dum_L1##c.$M2 $c1 $c2 $nonepyrs $cfixed, robust cluster(ccode)
outreg2 using table_debtdefault, dec(3) word label

su $M2 if e(sample), detail

margins, dydx(intrawar_dum_L1) at($M2 = (0(1)120))  

marginsplot, yline(0, lpattern(solid) lwidth(thin)) ///
	title("Model (6)", size(3))  ///	
	xtitle("Debt in Default (% of GDP)", size(3)) ///
	ytitle("", size(3))  ylabel(, labsize(small)) ///
	xscale(r(0(20)120)) xlabel(0(20)120, labsize(small)) recast(line) ciopt(color(%70)) recastci(rline) ///
	plotregion(fcolor(white)) graphregion(fcolor(white)) ///
	legend(off) scheme(s1mono) saving(figure_debtdefault_2.gph, replace) ///
	addplot(hist $M2 if $M2<120, xlabel(0(20)120, labsize(small)) freq yaxis(2) yscale(alt axis(2)) bin(600) lcolor(grayscale7) lwidth(vvthin) color(grayscale6%20) xline(9.903467, lpattern(dash) lwidth(vthin)) ytitle("", axis(2)) ylabel("", axis(2))      ) 

count if e(sample)
count if e(sample) & $M2 >= 39 & $M2 ~= .  // 5.9%

	
// Model (3) Negative Binomial with No Fixed Effects
nbreg expropriation intrawar_dum_L1##c.$M2 $c1 $c2, robust cluster(ccode)
outreg2 using table_debtdefault, dec(3) word label

su $M2 if e(sample), detail

margins, dydx(intrawar_dum_L1) at($M2 = (0(1)120))  

marginsplot, yline(0, lpattern(solid) lwidth(thin)) ///
	title("Model (7)", size(3))  ///	
	xtitle("Debt in Default (% of GDP)", size(3)) ///
	ytitle("", size(3))  ylabel(, labsize(small)) ///
	xscale(r(0(20)120)) xlabel(0(20)120, labsize(small)) recast(line) ciopt(color(%70)) recastci(rline) ///
	plotregion(fcolor(white)) graphregion(fcolor(white)) ///
	legend(off) scheme(s1mono) saving(figure_debtdefault_3.gph, replace) ///
	addplot(hist $M2 if $M2<120, xlabel(0(20)120, labsize(small)) freq yaxis(2) yscale(alt axis(2)) bin(600) lcolor(grayscale7) lwidth(vvthin) color(grayscale6%20) xline(11.90857, lpattern(dash) lwidth(vthin)) ytitle("", axis(2)) ylabel("", axis(2))      ) 

count if e(sample)
count if e(sample) & $M2 >= 34 & $M2 ~= .  // 8.7%
	
	
// Combining Graphs
graph combine figure_debtdefault_1.gph figure_debtdefault_2.gph figure_debtdefault_3.gph, saving(figure_debtdefault_123, replace) col(2)





*------------------------------------------------
* Figure 1 Full
*------------------------------------------------
graph combine figure_debttogdp_1.gph figure_debtdefault_1.gph figure_debttogdp_2.gph figure_debtdefault_2.gph figure_debttogdp_3.gph figure_debtdefault_3.gph, saving(figure1, replace) col(2) ysize(6) xsize(5.5)



	
		



*------------------------------------------------
* Table A1: Summary Statistics 
*------------------------------------------------
use repdata, clear

probit expropriation_dum intrawar_dum_L1##c.$M1 $c1 $c2 $nonepyrs, robust cluster(ccode)
asdoc sum expropriation_dum  intrawar_dum_L1 $M1 $c1 $nonepyrs if e(sample), save(summary) replace

nbreg expropriation intrawar_dum_L1##c.$M1 $c1 $c2, robust cluster(ccode)
asdoc sum expropriation if e(sample), save(summary) 

probit expropriation_dum intrawar_dum_L1##c.$M2 $c1 $c2 $nonepyrs, robust cluster(ccode)
asdoc sum $M2 if e(sample), save(summary) 



*--------------------------------------------------------------
* Table A2: Low-Intensity Intrastate Conflict
*--------------------------------------------------------------
use repdata, clear

global M1 "debtGDP_fill_L1" // Moderator1
global M2 "dept_gdp_boc_2023_L1" // Moderator2

global clow "wdi_lngdppc_L1 wdi_growth_L1 kaopen_L1 lnresource_L1 trade_WDI_L1 bitstodate_BIT_L1 lnaid_L1 unfdi_inflow_gdp_L1 cinc_milex_ln_L1 polconiii_L1 arch_lndura ucdp_interstate_L1 intrawar_dum"

eststo clear
eststo: probit expropriation_dum conflict_low_dum $clow $c2 $nonepyrs, robust cluster(ccode)
eststo: probit expropriation_dum conflict_low_dum##c.$M1 $clow $c2 $nonepyrs, robust cluster(ccode)
eststo: probit expropriation_dum conflict_low_dum##c.$M1 $clow $c2 $nonepyrs $cfixed, robust cluster(ccode)
eststo: nbreg expropriation conflict_low_dum##c.$M1 $clow $c2, robust cluster(ccode)
eststo: probit expropriation_dum conflict_low_dum##c.$M2 $clow $c2 $nonepyrs, robust cluster(ccode)
eststo: probit expropriation_dum conflict_low_dum##c.$M2 $clow $c2 $nonepyrs $cfixed, robust cluster(ccode)
eststo: nbreg expropriation conflict_low_dum##c.$M2 $clow $c2, robust cluster(ccode)
outreg2 [est1 est2 est3 est4 est5 est6 est7] using table_lowconflict, word dec(3) alpha(0.01, 0.05, 0.1) label replace 



*--------------------------------------------------------------
* Table A3 and Figure A1: Credit Rating Analysis
*--------------------------------------------------------------
use repdata, clear

eststo clear

// (1)
eststo: probit expropriation_dum intrawar_dum_L1##c.iirating_L1 $c1 $c2 $nonepyrs, robust cluster(ccode)
margins, dydx(intrawar_dum_L1) at(iirating_L1 = (0(1)100))  
marginsplot, yline(0, lpattern(solid) lwidth(thin)) ///
	title("Model (1)", size(3))  ///	
	xtitle("Credit Rating", size(3)) ///
	ytitle("", size(3)) ylabel(, labsize(small)) ///
	xlabel(, labsize(small)) recast(line) ciopt(color(%70)) recastci(rline) ///
	plotregion(fcolor(white)) graphregion(fcolor(white)) ///
	legend(off) scheme(s1mono) saving(figure_credit_1.gph, replace) ///
	addplot(hist iirating_L1 if iirating_L1<100, xlabel(, labsize(small)) freq yaxis(2) yscale(alt axis(2)) bin(600) lcolor(grayscale7) lwidth(vvthin) color(grayscale6%20) xline(32.01472, lpattern(dash) lwidth(vthin)) ytitle("", axis(2)) ylabel("", axis(2))      ) 

// (2)
eststo: probit expropriation_dum intrawar_dum_L1##c.iirating_L1 $c1 $c2 $nonepyrs $cfixed, robust cluster(ccode)
margins, dydx(intrawar_dum_L1) at(iirating_L1 = (0(1)100))  
marginsplot, yline(0, lpattern(solid) lwidth(thin)) ///
	title("Model (2)", size(3))  ///	
	xtitle("Credit Rating", size(3)) ///
	ytitle("", size(3)) ylabel(, labsize(small)) ///
	xscale(r(0(20)120)) xlabel(0(20)120, labsize(small)) recast(line) ciopt(color(%70)) recastci(rline) ///
	plotregion(fcolor(white)) graphregion(fcolor(white)) ///
	legend(off) scheme(s1mono) saving(figure_credit_2.gph, replace) ///
	addplot(hist iirating_L1 if iirating_L1<100, xlabel(, labsize(small)) freq yaxis(2) yscale(alt axis(2)) bin(600) lcolor(grayscale7) lwidth(vvthin) color(grayscale6%20) xline(32.01472, lpattern(dash) lwidth(vthin)) ytitle("", axis(2)) ylabel("", axis(2))      ) 

// (3)	
eststo: nbreg expropriation intrawar_dum_L1##c.iirating_L1 $c1 $c2, robust cluster(ccode)
margins, dydx(intrawar_dum_L1) at(iirating_L1 = (0(1)100))
marginsplot, yline(0, lpattern(solid) lwidth(thin)) ///
	title("Model (3)", size(3))  ///	
	xtitle("Credit Rating", size(3)) ///
	ytitle("", size(3)) ylabel(, labsize(small)) ///
	xscale(r(0(20)120)) xlabel(0(20)120, labsize(small)) recast(line) ciopt(color(%70)) recastci(rline) ///
	plotregion(fcolor(white)) graphregion(fcolor(white)) ///
	legend(off) scheme(s1mono) saving(figure_credit_3.gph, replace) ///
	addplot(hist iirating_L1 if iirating_L1<100, xlabel(, labsize(small)) freq yaxis(2) yscale(alt axis(2)) bin(600) lcolor(grayscale7) lwidth(vvthin) color(grayscale6%20) xline(32.01472, lpattern(dash) lwidth(vthin)) ytitle("", axis(2)) ylabel("", axis(2))      ) 
	
outreg2 [est1 est2 est3] using table_creditrating, word dec(3) alpha(0.01, 0.05, 0.1) label replace 

graph combine figure_credit_1.gph figure_credit_2.gph figure_credit_3.gph, saving(figure_credit_123, replace) col(2)


		
*----------------------------------------------------
* Table A4 and Figure A2: Conflict Intensity * Debt 
*----------------------------------------------------
use repdata, clear

eststo clear
eststo: probit expropriation_dum c.intensity_level_L1##c.$M1 $c1 $c2 $nonepyrs, robust cluster(ccode)
eststo: probit expropriation_dum c.cumulative_intensity_L1##c.$M1 $c1 $c2 $nonepyrs, robust cluster(ccode)
eststo: probit expropriation_dum c.intensity_level_L1##c.$M1 $c1 $c2 $nonepyrs $cfixed, robust cluster(ccode)
eststo: probit expropriation_dum c.cumulative_intensity_L1##c.$M1 $c1 $c2 $nonepyrs $cfixed, robust cluster(ccode)

outreg2 [est1 est2 est3 est4] using table_intensity, word dec(3) alpha(0.01, 0.05, 0.1) label replace 

// intensity model no fixed
probit expropriation_dum c.intensity_level_L1##c.$M1 $c1 $c2 $nonepyrs, robust cluster(ccode)
su $M1 if e(sample), detail

margins, dydx(intensity_level_L1) at($M1 = (0(1)320))  
marginsplot, yline(0, lpattern(solid) lwidth(thin)) ///
	title("Model (1)", size(3))  ///	
	xtitle("Debt (% of GDP)", size(3)) ///
	ytitle("", size(3)) ylabel(, labsize(small)) ///
	xscale(r(0(50)320)) xlabel(0(50)320, labsize(small)) recast(line) ciopt(color(%70)) recastci(rline) ///
	plotregion(fcolor(white)) graphregion(fcolor(white)) ///
	legend(off) scheme(s1mono) saving(figure_intensity1.gph, replace) ///
	addplot(hist $M1 if $M1<320, xlabel(0(50)320, labsize(small)) freq yaxis(2) yscale(alt axis(2)) bin(600) lcolor(grayscale7) lwidth(vvthin) color(grayscale6%20) ytitle("", axis(2)) ylabel("", axis(2))      ) 


// cumulative intensity model no fixed
probit expropriation_dum c.cumulative_intensity_L1##c.$M1 $c1 $c2 $nonepyrs, robust cluster(ccode)
su $M1 if e(sample), detail

margins, dydx(cumulative_intensity_L1) at($M1 = (0(1)320))  
marginsplot, yline(0, lpattern(solid) lwidth(thin)) ///
	title("Model (2)", size(3))  ///	
	xtitle("Debt (% of GDP)", size(3)) ///
	ytitle("", size(3)) ylabel(, labsize(small)) ///
	xscale(r(0(50)320)) xlabel(0(50)320, labsize(small)) recast(line) ciopt(color(%70)) recastci(rline) ///
	plotregion(fcolor(white)) graphregion(fcolor(white)) ///
	legend(off) scheme(s1mono) saving(figure_intensity2.gph, replace) ///
	addplot(hist $M1 if $M1<320, xlabel(0(50)320, labsize(small)) freq yaxis(2) yscale(alt axis(2)) bin(600) lcolor(grayscale7) lwidth(vvthin) color(grayscale6%20) ytitle("", axis(2)) ylabel("", axis(2))      ) 


// intensity model with fixed
probit expropriation_dum c.intensity_level_L1##c.$M1 $c1 $c2 $nonepyrs $cfixed, robust cluster(ccode)
su $M1 if e(sample), detail

margins, dydx(intensity_level_L1) at($M1 = (0(1)320))  
marginsplot, yline(0, lpattern(solid) lwidth(thin)) ///
	title("Model (3)", size(3))  ///	
	xtitle("Debt (% of GDP)", size(3)) ///
	ytitle("", size(3)) ylabel(, labsize(small)) ///
	xscale(r(0(50)320)) xlabel(0(50)320, labsize(small)) recast(line) ciopt(color(%70)) recastci(rline) ///
	plotregion(fcolor(white)) graphregion(fcolor(white)) ///
	legend(off) scheme(s1mono) saving(figure_intensity3.gph, replace) ///
	addplot(hist $M1 if $M1<320, xlabel(0(50)320, labsize(small)) freq yaxis(2) yscale(alt axis(2)) bin(600) lcolor(grayscale7) lwidth(vvthin) color(grayscale6%20) ytitle("", axis(2)) ylabel("", axis(2))      ) 


// cumulative intensity model with fixed
probit expropriation_dum c.cumulative_intensity_L1##c.$M1 $c1 $c2 $nonepyrs $cfixed, robust cluster(ccode)
su $M1 if e(sample), detail

margins, dydx(cumulative_intensity_L1) at($M1 = (0(1)320))  
marginsplot, yline(0, lpattern(solid) lwidth(thin)) ///
	title("Model (4)", size(3))  ///	
	xtitle("Debt (% of GDP)", size(3)) ///
	ytitle("", size(3)) ylabel(, labsize(small)) ///
	xscale(r(0(50)320)) xlabel(0(50)320, labsize(small)) recast(line) ciopt(color(%70)) recastci(rline) ///
	plotregion(fcolor(white)) graphregion(fcolor(white)) ///
	legend(off) scheme(s1mono) saving(figure_intensity4.gph, replace) ///
	addplot(hist $M1 if $M1<320, xlabel(0(50)320, labsize(small)) freq yaxis(2) yscale(alt axis(2)) bin(600) lcolor(grayscale7) lwidth(vvthin) color(grayscale6%20) ytitle("", axis(2)) ylabel("", axis(2))      ) 


graph combine figure_intensity1.gph figure_intensity2.gph figure_intensity3.gph figure_intensity4.gph, saving(figure_intensity1234, replace) col(2)



*----------------------------------------------------
* Table A5 and A6: Split Sample Analyses
*----------------------------------------------------

// When debtGDP is below mean and above mean : 58%
gen debtGDP_dum = 0 if $M1 <= 58
replace debtGDP_dum = 1 if $M1 > 58
replace debtGDP_dum = . if $M1 == .


eststo clear
eststo: probit expropriation_dum intensity_level_L1 $c1 $c2 $nonepyrs if debtGDP_dum == 0 , robust cluster(ccode)
eststo: probit expropriation_dum intensity_level_L1 $c1 $c2 $nonepyrs if debtGDP_dum == 1 , robust cluster(ccode)
eststo: probit expropriation_dum cumulative_intensity_L1 $c1 $c2 $nonepyrs if debtGDP_dum == 0 , robust cluster(ccode)
eststo: probit expropriation_dum cumulative_intensity_L1 $c1 $c2 $nonepyrs if debtGDP_dum == 1 , robust cluster(ccode)

outreg2 [est1 est2 est3 est4] using table_intensity_debtgdpdum, word dec(3) alpha(0.01, 0.05, 0.1) label replace 
	
	
	
eststo clear
eststo: probit expropriation_dum intensity_level_L1 $c1 $c2 $nonepyrs $cfixed if debtGDP_dum == 0 , robust cluster(ccode)
eststo: probit expropriation_dum intensity_level_L1 $c1 $c2 $nonepyrs $cfixed if debtGDP_dum == 1 , robust cluster(ccode)
eststo: probit expropriation_dum cumulative_intensity_L1 $c1 $c2 $nonepyrs $cfixed if debtGDP_dum == 0 , robust cluster(ccode)
eststo: probit expropriation_dum cumulative_intensity_L1 $c1 $c2 $nonepyrs $cfixed if debtGDP_dum == 1 , robust cluster(ccode)
	
outreg2 [est1 est2 est3 est4] using table_intensity_debtgdpdum_fixed, word dec(3) alpha(0.01, 0.05, 0.1) label replace 
	

		
*-------------------------------------------------------
* Table A7 and Figure A3: Resource Sector Expropriation
*-------------------------------------------------------

eststo clear	
eststo: probit resource_dum intrawar_dum_L1##c.$M1 $c1 $c2 $nonepyrs, robust cluster(ccode)
eststo: probit resource_dum intrawar_dum_L1##c.$M1 $c1 $c2 $nonepyrs $cfixed, robust cluster(ccode)
eststo: nbreg resource intrawar_dum_L1##c.$M1 $c1 $c2, robust cluster(ccode)
eststo: probit resource_dum intrawar_dum_L1##c.$M2 $c1 $c2 $nonepyrs, robust cluster(ccode)
eststo: probit resource_dum intrawar_dum_L1##c.$M2 $c1 $c2 $nonepyrs $cfixed, robust cluster(ccode)
eststo: nbreg resource intrawar_dum_L1##c.$M2 $c1 $c2, robust cluster(ccode)

outreg2 [est1 est2 est3 est4 est5 est6] using table_resource, word dec(3) alpha(0.01, 0.05, 0.1) label replace 
	
	
probit resource_dum intrawar_dum_L1##c.$M1 $c1 $c2 $nonepyrs, robust cluster(ccode)
margins, dydx(intrawar_dum_L1) at($M1 = (0(1)320))  
marginsplot, yline(0, lpattern(solid) lwidth(thin)) ///
	title("Model (1)", size(3))  ///	
	xtitle("Debt (% of GDP)", size(3)) ///
	ytitle("", size(3)) ylabel(, labsize(small)) ///
	xscale(r(0(50)320)) xlabel(0(50)320, labsize(small)) recast(line) ciopt(color(%70)) recastci(rline) ///
	plotregion(fcolor(white)) graphregion(fcolor(white)) ///
	legend(off) scheme(s1mono) saving(resource1.gph, replace) ///
	addplot(hist $M1 if $M1<320, xlabel(0(50)320, labsize(small)) freq yaxis(2) yscale(alt axis(2)) bin(600) lcolor(grayscale7) lwidth(vvthin) color(grayscale6%20) xline(62.5864, lpattern(dash) lwidth(vthin)) ytitle("", axis(2)) ylabel("", axis(2))      ) 
	
probit resource_dum intrawar_dum_L1##c.$M1 $c1 $c2 $nonepyrs $cfixed, robust cluster(ccode)
margins, dydx(intrawar_dum_L1) at($M1 = (0(1)320))  
marginsplot, yline(0, lpattern(solid) lwidth(thin)) ///
	title("Model (2)", size(3))  ///	
	xtitle("Debt (% of GDP)", size(3)) ///
	ytitle("", size(3)) ylabel(, labsize(small)) ///
	xscale(r(0(50)320)) xlabel(0(50)320, labsize(small)) recast(line) ciopt(color(%70)) recastci(rline) ///
	plotregion(fcolor(white)) graphregion(fcolor(white)) ///
	legend(off) scheme(s1mono) saving(resource2.gph, replace) ///
	addplot(hist $M1 if $M1<320, xlabel(0(50)320, labsize(small)) freq yaxis(2) yscale(alt axis(2)) bin(600) lcolor(grayscale7) lwidth(vvthin) color(grayscale6%20) xline(62.5864, lpattern(dash) lwidth(vthin)) ytitle("", axis(2)) ylabel("", axis(2))      ) 

nbreg resource intrawar_dum_L1##c.$M1 $c1 $c2, robust cluster(ccode)
margins, dydx(intrawar_dum_L1) at($M1 = (0(1)320))  
marginsplot, yline(0, lpattern(solid) lwidth(thin)) ///
	title("Model (3)", size(3))  ///	
	xtitle("Debt (% of GDP)", size(3)) ///
	ytitle("", size(3)) ylabel(, labsize(small)) ///
	xscale(r(0(50)320)) xlabel(0(50)320, labsize(small)) recast(line) ciopt(color(%70)) recastci(rline) ///
	plotregion(fcolor(white)) graphregion(fcolor(white)) ///
	legend(off) scheme(s1mono) saving(resource3.gph, replace) ///
	addplot(hist $M1 if $M1<320, xlabel(0(50)320, labsize(small)) freq yaxis(2) yscale(alt axis(2)) bin(600) lcolor(grayscale7) lwidth(vvthin) color(grayscale6%20) xline(62.5864, lpattern(dash) lwidth(vthin)) ytitle("", axis(2)) ylabel("", axis(2))      ) 

probit resource_dum intrawar_dum_L1##c.$M2 $c1 $c2 $nonepyrs, robust cluster(ccode)
margins, dydx(intrawar_dum_L1) at($M2 = (0(1)120))  
marginsplot, yline(0, lpattern(solid) lwidth(thin)) ///
	title("Model (4)", size(3))  ///	
	xtitle("Debt in Default (% of GDP)", size(3)) ///
	ytitle("", size(3))  ylabel(, labsize(small)) ///
	xscale(r(0(20)120)) xlabel(0(20)120, labsize(small)) recast(line) ciopt(color(%70)) recastci(rline) ///
	plotregion(fcolor(white)) graphregion(fcolor(white)) ///
	legend(off) scheme(s1mono) saving(resource4.gph, replace) ///
	addplot(hist $M2 if $M2<120, xlabel(0(20)120, labsize(small)) freq yaxis(2) yscale(alt axis(2)) bin(600) lcolor(grayscale7) lwidth(vvthin) color(grayscale6%20) xline(9.903467, lpattern(dash) lwidth(vthin)) ytitle("", axis(2)) ylabel("", axis(2))      ) 

probit resource_dum intrawar_dum_L1##c.$M2 $c1 $c2 $nonepyrs $cfixed, robust cluster(ccode)
margins, dydx(intrawar_dum_L1) at($M2 = (0(1)120))  
marginsplot, yline(0, lpattern(solid) lwidth(thin)) ///
	title("Model (5)", size(3))  ///	
	xtitle("Debt in Default (% of GDP)", size(3)) ///
	ytitle("", size(3))  ylabel(, labsize(small)) ///
	xscale(r(0(20)120)) xlabel(0(20)120, labsize(small)) recast(line) ciopt(color(%70)) recastci(rline) ///
	plotregion(fcolor(white)) graphregion(fcolor(white)) ///
	legend(off) scheme(s1mono) saving(resource5.gph, replace) ///
	addplot(hist $M2 if $M2<120, xlabel(0(20)120, labsize(small)) freq yaxis(2) yscale(alt axis(2)) bin(600) lcolor(grayscale7) lwidth(vvthin) color(grayscale6%20) xline(9.903467, lpattern(dash) lwidth(vthin)) ytitle("", axis(2)) ylabel("", axis(2))      ) 

nbreg resource intrawar_dum_L1##c.$M2 $c1 $c2, robust cluster(ccode)
margins, dydx(intrawar_dum_L1) at($M2 = (0(1)120))  
marginsplot, yline(0, lpattern(solid) lwidth(thin)) ///
	title("Model (6)", size(3))  ///	
	xtitle("Debt in Default (% of GDP)", size(3)) ///
	ytitle("", size(3))  ylabel(, labsize(small)) ///
	xscale(r(0(20)120)) xlabel(0(20)120, labsize(small)) recast(line) ciopt(color(%70)) recastci(rline) ///
	plotregion(fcolor(white)) graphregion(fcolor(white)) ///
	legend(off) scheme(s1mono) saving(resource6.gph, replace) ///
	addplot(hist $M2 if $M2<120, xlabel(0(20)120, labsize(small)) freq yaxis(2) yscale(alt axis(2)) bin(600) lcolor(grayscale7) lwidth(vvthin) color(grayscale6%20) xline(9.903467, lpattern(dash) lwidth(vthin)) ytitle("", axis(2)) ylabel("", axis(2))      ) 
	
	
graph combine resource1.gph resource2.gph resource3.gph resource4.gph resource5.gph resource6.gph, saving(resource123456, replace) col(2)
	
	
	
*-------------------------------------------------------
* Table A8: oil price control
*-------------------------------------------------------
	
eststo clear	
eststo: probit expropriation_dum intrawar_dum_L1##c.$M1 $c1 $c2 oilprice $nonepyrs, robust cluster(ccode)
eststo: probit expropriation_dum intrawar_dum_L1##c.$M1 $c1 $c2 oilprice $nonepyrs $cfixed, robust cluster(ccode)
eststo: nbreg expropriation intrawar_dum_L1##c.$M1 $c1 $c2 oilprice, robust cluster(ccode)
eststo: probit expropriation_dum intrawar_dum_L1##c.$M2 $c1 $c2 oilprice $nonepyrs, robust cluster(ccode)
eststo: probit expropriation_dum intrawar_dum_L1##c.$M2 $c1 $c2 oilprice $nonepyrs $cfixed, robust cluster(ccode)
eststo: nbreg expropriation intrawar_dum_L1##c.$M2 $c1 $c2 oilprice, robust cluster(ccode)

outreg2 [est1 est2 est3 est4 est5 est6] using table_oil, word dec(3) alpha(0.01, 0.05, 0.1) label replace 
	
	
	
	
	

	
	
	




		
	
	
	


